{%- extends "base.html" %}

{%- block title %}
{% trans %}New user{% endtrans %}
{%- endblock %}

{%- block subtitle %}
{{ domain.name }}
{%- endblock %}

{%- block content %}
<form class="form" method="post" role="form">
  {{ form.hidden_tag() }}

  {%- call macros.card(_("General")) %}
  {{ macros.form_field(form.localpart, append='<span class="input-group-text">@'+domain.name+'</span>') }}
  {{ macros.form_fields((form.pw, form.pw2)) }}
  {{ macros.form_field(form.displayed_name) }}
  {{ macros.form_field(form.comment) }}
  {{ macros.form_field(form.enabled) }}
  {{ macros.form_field(form.change_pw_next_login) }}
  {%- endcall %}

  {%- call macros.card(_("Features and quotas"), theme="success") %}
  {{ macros.form_field(form.quota_bytes, step=50*10**6, max=(max_quota_bytes or domain.max_quota_bytes or 50*10**9), data_infinity="true", data_unit=10**9,
      prepend='<span class="input-group-text"><span id="quota_bytes_value"></span>&nbsp;GB</span>') }}
  {{ macros.form_field(form.enable_imap) }}
  {{ macros.form_field(form.enable_pop) }}
  {{ macros.form_field(form.allow_spoofing) }}
  {%- endcall %}

  {{ macros.form_field(form.submit) }}
</form>
{%- endblock %}
